<?php
/* @var $this GenerateFormController */
/* @var $model GenerateForm */
/* @var $form CActiveForm */
?>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'generate-form-article-form',
	'enableAjaxValidation'=>true,
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'wordCount'); ?>
		<?php $num = rand(450,700);?>
		<?php echo $form->textField($model,'wordCount',array('value'=>$num)); ?>
		<?php echo $form->error($model,'wordCount'); ?>
		<?php echo CHtml::ajaxSubmitButton('Submit',$form->action,array('success'=>'js:function(data){
			$("#articleArea").html(data);
		}')); ?>
	</div>

	<div class="row">
		<textarea rows="20" cols="100" id="articleArea"></textarea>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->